﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CF.Data.Entity.FrmMemberEntity;

namespace CF.Member.DAL.Badges
{
    public class FM_MyBadgesDAL
    {
        public List<v_FM_MyBadge_Config> GetMyAllBadges(int uid)
        {
            List<v_FM_MyBadge_Config> bdlist = new List<v_FM_MyBadge_Config>();
            caifendbEntities context = new caifendbEntities();
            var query = context.v_FM_MyBadge_Config.Where(c => c.UID == uid);
            bdlist = query.ToList();
            return bdlist;
        }

        public v_FM_MyBadge_Config GetMyBadge(int uid, int bid)
        {
            caifendbEntities context = new caifendbEntities();
            v_FM_MyBadge_Config myBadgeConfig = context.v_FM_MyBadge_Config.FirstOrDefault(c => c.UID == uid && c.BID == bid);
            return myBadgeConfig;
        }
    }
}
